<div class="layui-tab layui-tab-card">
    <ul class="layui-tab-title">
        {if checkPermission('SystemConfig/webContent')}
        <li class="layui-this">网站配置</li>
        {/if}
        {if checkPermission('SystemConfig/wxOauth')}
        <li>微信公众号配置</li>
        {/if}
        {if checkPermission('SystemConfig/wxMinaOauth')}
        <li>微信小程序配置</li>
        {/if}
        {if checkPermission('SystemConfig/alipay')}
        <li>支付宝配置</li>
        {/if}
        {if checkPermission('SystemConfig/mailer')}
        <li>邮箱配置</li>
        {/if}
        {if checkPermission('SystemConfig/aliyunSms')}
        <li>阿里云短信配置</li>
        {/if}
    </ul>
    <div class="layui-tab-content">
        {if checkPermission('SystemConfig/webContent')}
        <div class="layui-tab-item layui-show">
            <form id="form" class="layui-form" action="{:url('SystemConfig/webContent')}" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">网站名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value="{$data['WEB_CONTENT']['value']['name']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">网站域名</label>
                    <div class="layui-input-block">
                        <input type="text" name="domain" value="{$data['WEB_CONTENT']['value']['domain']}" placeholder="例：http://www.ecoci.cn" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">网站标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" value="{$data['WEB_CONTENT']['value']['title']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">网站关键字</label>
                    <div class="layui-input-block">
                        <input type="text" name="keywords" value="{$data['WEB_CONTENT']['value']['keywords']}" placeholder="多个用英文逗号隔开" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">网站描述</label>
                    <div class="layui-input-block">
                        <input type="text" name="description" value="{$data['WEB_CONTENT']['value']['description']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">网站作者</label>
                    <div class="layui-input-block">
                        <input type="text" name="author" value="{$data['WEB_CONTENT']['value']['author']}" placeholder="请输入联系方式或名字" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">网站版权号</label>
                    <div class="layui-input-block">
                        <input type="text" name="copyright" value="{$data['WEB_CONTENT']['value']['copyright']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn submitForm" formId="form">提交</button>
                    </div>
                </div>
            </form>
        </div>
        {/if}

        {if checkPermission('SystemConfig/wxOauth')}
        <div class="layui-tab-item">
            <form id="form1" class="layui-form" action="{:url('SystemConfig/wxOauth')}" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">公众号名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value="{$data['WECHAT_OAUTH']['value']['name']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">公众号ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="appid" value="{$data['WECHAT_OAUTH']['value']['appid']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">公众号密钥</label>
                    <div class="layui-input-block">
                        <input type="text" name="appsecret" value="{$data['WECHAT_OAUTH']['value']['appsecret']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">微信支付商户号</label>
                    <div class="layui-input-block">
                        <input type="text" name="mch_id" value="{$data['WECHAT_OAUTH']['value']['mch_id']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">微信支付密钥</label>
                    <div class="layui-input-block">
                        <input type="text" name="key" value="{$data['WECHAT_OAUTH']['value']['key']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn submitForm" formId="form1">提交</button>
                    </div>
                </div>
            </form>
        </div>
        {/if}

        {if checkPermission('SystemConfig/wxMinaOauth')}
        <div class="layui-tab-item">
            <form id="form2" class="layui-form" action="{:url('SystemConfig/wxMinaOauth')}" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">小程序名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value="{$data['WECHAT_MINA_OAUTH']['value']['name']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">小程序ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="appid" value="{$data['WECHAT_MINA_OAUTH']['value']['appid']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">小程序密钥</label>
                    <div class="layui-input-block">
                        <input type="text" name="appsecret" value="{$data['WECHAT_MINA_OAUTH']['value']['appsecret']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">微信支付商户号</label>
                    <div class="layui-input-block">
                        <input type="text" name="mch_id" value="{$data['WECHAT_MINA_OAUTH']['value']['mch_id']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">微信支付密钥</label>
                    <div class="layui-input-block">
                        <input type="text" name="key" value="{$data['WECHAT_MINA_OAUTH']['value']['key']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn submitForm" formId="form2">提交</button>
                    </div>
                </div>
            </form>
        </div>
        {/if}

        {if checkPermission('SystemConfig/alipay')}
        <div class="layui-tab-item">
            <form id="form3" class="layui-form" action="{:url('SystemConfig/alipay')}" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">app_id</label>
                    <div class="layui-input-block">
                        <input type="text" name="app_id" value="{$data['ALIPAY_PAY']['value']['app_id']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商户私钥</label>
                    <div class="layui-input-block">
                        <input type="text" name="merchant_private_key" value="{$data['ALIPAY_PAY']['value']['merchant_private_key']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商户公钥</label>
                    <div class="layui-input-block">
                        <input type="text" name="merchant_public_key" value="{$data['ALIPAY_PAY']['value']['merchant_public_key']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">支付宝公钥</label>
                    <div class="layui-input-block">
                        <input type="text" name="alipay_public_key" value="{$data['ALIPAY_PAY']['value']['alipay_public_key']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">异步通知地址</label>
                    <div class="layui-input-block">
                        <input type="text" name="notify_url" value="{$data['ALIPAY_PAY']['value']['notify_url']}" placeholder="接口域名/Notify/alipayNotify" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn submitForm" formId="form3">提交</button>
                    </div>
                </div>
            </form>
        </div>
        {/if}

        {if checkPermission('SystemConfig/mailer')}
        <div class="layui-tab-item">
            <form id="form4" class="layui-form" action="{:url('SystemConfig/mailer')}" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="from_name" value="{$data['MAILER']['value']['MAIL_FROMNAME']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">服务器host</label>
                    <div class="layui-input-block">
                        <input type="text" name="host" value="{$data['MAILER']['value']['MAIL_HOST']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">服务器port</label>
                    <div class="layui-input-block">
                        <input type="text" name="port" value="{$data['MAILER']['value']['MAIL_PORT']}" placeholder="465" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">username</label>
                    <div class="layui-input-block">
                        <input type="text" name="username" value="{$data['MAILER']['value']['MAIL_USERNAME']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">password</label>
                    <div class="layui-input-block">
                        <input type="text" name="password" value="{$data['MAILER']['value']['MAIL_PASSWORD']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn submitForm" formId="form4">提交</button>
                    </div>
                </div>
            </form>
        </div>
        {/if}

        {if checkPermission('SystemConfig/aliyunSms')}
        <div class="layui-tab-item">
            <form id="form5" class="layui-form" action="{:url('SystemConfig/aliyunSms')}" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">KeyId</label>
                    <div class="layui-input-block">
                        <input type="text" name="access_key_id" value="{$data['ALIYUN_SMS']['value']['access_key_id']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">KeySecret</label>
                    <div class="layui-input-block">
                        <input type="text" name="access_key_secret" value="{$data['ALIYUN_SMS']['value']['access_key_secret']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">签名名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="sign_name" value="{$data['ALIYUN_SMS']['value']['sign_name']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">验证码模板码</label>
                    <div class="layui-input-block">
                        <input type="text" name="verify_template_code" value="{$data['ALIYUN_SMS']['value']['verify_template_code']}" placeholder="请输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn submitForm" formId="form5">提交</button>
                    </div>
                </div>
            </form>
        </div>
        {/if}
    </div>
</div>

<script type="text/javascript">
    $(function(){

        $('.submitForm').click(function (evt) {
            formPost(evt, $(this), function (res) {
                ybLayer.msg(res.msg,{icon: 6});
//                setTimeout(function () {
//                    location.reload();
//                }, 1000);
            }, function (res) {
                ybLayer.msg(res.msg, {icon: 5});
            });
            return false;
        });
    })
</script>